/*
 * Home.java
 *
 * Created on January 29, 2007, 11:11 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
package ge.info.pages;

import ge.info.domain.others.OthersInfo;

import ge.ktapestry.pages.BasePageExt;
import ge.info.domain.StringString;
import java.util.ArrayList;
import java.util.List;
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.annotations.Persist;
import org.apache.tapestry.event.PageBeginRenderListener;
import org.apache.tapestry.event.PageEvent;

public abstract class OthersPage extends BasePageExt implements PageBeginRenderListener
{

    public static int SERVICE_ID = 32;

    public abstract List<StringString> getStrings();

    public abstract void setStrings(List<StringString> strings);

    public abstract StringString getStr();

    public abstract void setStr(StringString str);

    public abstract OthersInfo getOthi();

    public abstract void setOthi(OthersInfo othi);


    public abstract List<OthersInfo> getOthersInfo();

    public abstract void setOthersInfo(List<OthersInfo> othersInfo);

   
   // public abstract int getIndex();

   // public abstract void setIndex(int i);
    
    public abstract String getInfoCriteria();

    public abstract void setInfoCriteria(String s);

 

    public void pageBeginRender(PageEvent event)
    {

        if (!event.getRequestCycle().isRewinding())
        {
          this.setStrings(getDbExecutor().getOthersSection());
        }
    }

    

    public void sI(IRequestCycle cycle,Integer ID)
    {

        

       OthersInfo oth=new OthersInfo();

       if (ID!=null)
       {

        oth.setSectionID(ID);
       }
       else
       {
           oth.setSectionID(0);
       }

       if (getInfoCriteria()!=null)
       {

        oth.setInfoCriteria(getInfoCriteria());

       }

        setOthersInfo(getDbExecutor().searchInfo(oth));



    }

    public void clear(IRequestCycle cycle)
    {
        setInfoCriteria(null);
         OthersInfo oth=new OthersInfo();
    }

    
}
